package com.trsjh.db.domains;
// Generated 2012-1-13 12:55:11 by Hibernate Tools 3.4.0.CR1


import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Order generated by hbm2java
 */
@Entity
@Table(name="orders"
,catalog="myglass"
		)
public class Order  implements java.io.Serializable {


	/**
	 * 
	 */
	private static final long serialVersionUID = -5017816967652712369L;

	@Id @GeneratedValue(strategy=IDENTITY)
	@Column(name="id", unique=true, nullable=false)
	private Integer id;

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="customerAccount")
	private CustomerAccount customerAccount;

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="cashier")
	private User user;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="time", nullable=false, length=19)
	private Date time;

	@Column(name="realmoney", precision=9)
	private BigDecimal realmoney;

	@Column(name="fapiao")
	private Boolean fapiao;

	@Column(name="note", length=500)
	private String note;

	@Column(name="discount", precision=9)
	private BigDecimal discount;

	@Column(name="gift")
	private String gift;

	@OneToMany(fetch=FetchType.LAZY, mappedBy="order")
	private Set<GlassOrder> glassOrders = new HashSet<GlassOrder>(0);

	@OneToMany(fetch=FetchType.LAZY, mappedBy="order")
	private Set<OthersOrder> othersOrders = new HashSet<OthersOrder>(0);

	public Order() {
	}


	public Order(Date time) {
		this.time = time;
	}
	public Order(CustomerAccount customerAccount, User user, Date time, BigDecimal realmoney, Boolean fapiao, String note, BigDecimal discount, String gift, Set<GlassOrder> glassOrderses, Set<OthersOrder> othersOrderses) {
		this.customerAccount = customerAccount;
		this.user = user;
		this.time = time;
		this.realmoney = realmoney;
		this.fapiao = fapiao;
		this.note = note;
		this.discount = discount;
		this.gift = gift;
		this.glassOrders = glassOrderses;
		this.othersOrders = othersOrderses;
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	public CustomerAccount getCustomerAccounts() {
		return this.customerAccount;
	}

	public void setCustomerAccounts(CustomerAccount customerAccount) {
		this.customerAccount = customerAccount;
	}
	public User getUsers() {
		return this.user;
	}

	public void setUsers(User user) {
		this.user = user;
	}
	public Date getTime() {
		return this.time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public BigDecimal getRealmoney() {
		return this.realmoney;
	}

	public void setRealmoney(BigDecimal realmoney) {
		this.realmoney = realmoney;
	}

	public Boolean getFapiao() {
		return this.fapiao;
	}

	public void setFapiao(Boolean fapiao) {
		this.fapiao = fapiao;
	}

	public String getNote() {
		return this.note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public BigDecimal getDiscount() {
		return this.discount;
	}

	public void setDiscount(BigDecimal discount) {
		this.discount = discount;
	}

	public String getGift() {
		return this.gift;
	}

	public void setGift(String gift) {
		this.gift = gift;
	}


	public CustomerAccount getCustomerAccount() {
		return customerAccount;
	}


	public void setCustomerAccount(CustomerAccount customerAccount) {
		this.customerAccount = customerAccount;
	}


	public User getUser() {
		return user;
	}


	public void setUser(User user) {
		this.user = user;
	}


	public Set<GlassOrder> getGlassOrders() {
		return glassOrders;
	}


	public void setGlassOrders(Set<GlassOrder> glassOrders) {
		this.glassOrders = glassOrders;
	}


	public Set<OthersOrder> getOthersOrders() {
		return othersOrders;
	}


	public void setOthersOrders(Set<OthersOrder> othersOrders) {
		this.othersOrders = othersOrders;
	}





}


